
import { request } from 'umi';

function http(params) {
    let [method, url] = params.split(' ');
    return function (data = {}, options = {}) {
        return request(url, {
            method,
            params: method === "GET" ? data : {},
            data: method === "POST" ? data : {},
            ...(options || {}),
        })
    }
}

export default http;